#ifndef ELEMENTS_FIELD_TYPE_H
#define ELEMENTS_FIELD_TYPE_H

#include "element.h"

namespace Elements
{

struct FieldType : public Element
{
    enum class ValueType : unsigned
    {
        String = 0,
        MarkdownText = 1,
        Integer = 2,
        Float = 3,
        Bool = 4,
        DateTime = 5,
        Uri = 6,
        // Зарезервировано
        Select = 50,
        SelectMulti = 51,
        // Зарезервировано
        ItemId = 100,
        UserId = 101,
        ProjectId = 102,
        PhaseId = 103,
        // Зарезервировано
        ItemsIds = 200,
        UsersIds = 201,
        ProjectsIds = 202,
        PhasesIds = 203,
    };

    FieldType() = default;
    FieldType(const FieldType& other);

    // -- Интерфейс элемента -- //

    virtual bool isSame(Element* other) const override;

    virtual Common::Json toJson() const override;
    virtual void fromJson(const Common::Json& json) override;

    virtual Element* clone() const override;
    virtual ElementType elementType() const override;

    // -- Интерфейс данных -- //

    unsigned itemTypeId() const;
    void setItemTypeId(const unsigned value);

    std::string caption() const;
    void setCaption(const std::string& value);

    std::string description() const;
    void setDescription(const std::string& value);

    ValueType valueType() const;
    void setValueType(const ValueType value);

    bool isBoardVisible() const;
    void setIsBoardVisible(const bool value);

private:
    unsigned m_itemTypeId;
    std::string m_caption;
    std::string m_description;
    ValueType m_valueType;
    bool m_isBoardVisible;

};

typedef std::shared_ptr<FieldType> FieldTypePtr;
typedef std::vector<FieldTypePtr> FieldTypes;

} // namespace Elements

#endif // ELEMENTS_FIELD_TYPE_H
